﻿using FlexFlow.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlexFlow.Base.Interface
{
    /// <summary>
    /// 表示流程实例提供器提供接口
    /// </summary>
    public interface IProcessInstanceProvider : IPhysicalEntityProvider<ProcessInstance>
    {
        /// <summary>
        /// 更新流程实例状态
        /// </summary>
        /// <param name="procInsId">
        /// 要更新状态的流程实例Id
        /// </param>
        /// <param name="state">
        /// 要更新的状态
        /// </param>
        /// <returns>
        /// 更新结果
        /// </returns>
        /// <remarks>
        /// 请级联更新LastFlowTime
        /// </remarks>
        bool UpdateState(Guid procInsId, ProcessInstanceState state);
        /// <summary>
        /// 更新指定流程实例的当前活动
        /// </summary>
        /// <param name="procInsId">
        /// 流程实例Id
        /// </param>
        /// <param name="currentActId">
        /// 当前活动Id
        /// </param>
        /// <returns>
        /// 更新结果
        /// </returns>
        /// <remarks>
        /// 请级联更新LastFlowTime
        /// </remarks>
        bool UpdateCurrentActivity(Guid procInsId, Guid currentActId);
        /// <summary>
        /// 根据用户ID取得流程实例列表
        /// </summary>
        /// <param name="userId">
        /// 用户ID
        /// </param>
        /// <returns>
        /// 流程实例列表
        /// </returns>
        List<ProcessInstance> GetByUID(Guid userId);
    }
}
